From: Giovanni Campagna Date: Thu, 8 May 2014 17:17:26 +0000 (+0200) Subject: WorkspacesView: don't access the allocation 4 times X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2382 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=37ef0e4bedec57d9e877e4ef3bb5065515bf77d6;p=gnome-shell.git WorkspacesView: don't access the allocation 4 times Access it once, and save 3 GObject property accesses and related copies. https://bugzilla.gnome.org/show_bug.cgi?id=729823 --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 3dfbe1e9b..61df6ab96 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -606,8 +606,9 @@ const WorkspacesDisplay = new Lang.Class({ return; let [x, y] = this.actor.get_transformed_position(); - let width = this.actor.allocation.x2 - this.actor.allocation.x1; - let height = this.actor.allocation.y2 - this.actor.allocation.y1; + let allocation = this.actor.allocation; + let width = allocation.x2 - allocation.x1; + let height = allocation.y2 - allocation.y1; let primaryGeometry = { x: x, y: y, width: width, height: height }; let monitors = Main.layoutManager.monitors;